home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / patches / patch2amitcp_4.3 / bin / patcher! < prev    next >
AmigaDOS Script File  |  1996-04-07  |  1KB  |  68 lines

  1. .KEY RXCMD/A,tdir/A,SFILE/A,PFILE/A
  2. .BRA {
  3. .KET }
  4.  
  5. If Exists ENV:installer-result
  6.     Delete ENV:installer-result Quiet Force
  7. EndIf
  8.  
  9. set sum=`bin/tmd5sum "{SFILE}"`
  10.  
  11. FailAt 11
  12. {RXCMD} bin/patchfiles $sum patch/{PFILE} >"ENV:installer-result"
  13.  
  14. If ERROR
  15.     unset sum
  16.     Quit 10
  17. endif
  18. unset sum
  19.  
  20. set patches=`Type ENV:installer-result`
  21. ;Echo RXOUT $patches
  22.  
  23. if "$patches" EQ "NOMATCH"
  24. ;    Echo "Patch files not found !!!!" >"ENV:installer-result"
  25.     unset patches
  26.     Quit 11
  27. endif
  28.  
  29. if "$patches" EQ "PATCHED"
  30. ;    Echo {SFILE} "Already patched" >"ENV:installer-result"
  31.     unset patches
  32.     Quit 5
  33. endif
  34.  
  35. If Exists {tdir}NSDi_patched
  36.     Delete {tdir}NSDi_patched Quiet Force
  37. endif
  38. Copy "{SFILE}" {tdir}NSDi_patched
  39.  
  40. Lab Loop
  41.  
  42. set patchfile=`{RXCMD} "Say DelWord('$patches', 2)"`
  43. ;Echo PATCHFILE $patchfile
  44.  
  45. set patches="`{RXCMD} "Say DelWord('$patches', 1, 1)"`"
  46. ;Echo PATCHES $patches
  47.  
  48. If "$patches" EQ ""
  49. ;    set sum=`bin/tmd5sum {tdir}NSDi_patched`
  50. ;    If $sum NOT EQ $patchfile
  51. ;        Echo "Incorrect result file" >"ENV:installer-result"
  52. ;        unset patches
  53. ;        unset patchfiles
  54. ;        Quit 5
  55. ;    EndIf
  56.     Skip loppu
  57. EndIf
  58.  
  59. bin/spatch -o{tdir}NSDi_patching -ppatch/$patchfile {tdir}NSDi_patched
  60. Delete {tdir}NSDi_patched force quiet
  61. Rename {tdir}NSDi_patching {tdir}NSDi_patched
  62.  
  63. Skip BACK loop
  64. Lab loppu
  65.  
  66. unset patches
  67. unset patchfile
  68.